<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.18"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>embedme: libemb::ComUtil Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="logo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">embedme
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.18 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><b>libemb</b></li><li class="navelem"><a class="el" href="classlibemb_1_1_com_util.html">ComUtil</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="classlibemb_1_1_com_util-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">libemb::ComUtil Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>通用工具类  
 <a href="classlibemb_1_1_com_util.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="_com_util_8h_source.html">ComUtil.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a104d0ba364c6234dc633495f69527ee3"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_com_util.html#a104d0ba364c6234dc633495f69527ee3">equal</a> (float f1, float f2, float precision)</td></tr>
<tr class="memdesc:a104d0ba364c6234dc633495f69527ee3"><td class="mdescLeft">&#160;</td><td class="mdescRight">判断两个浮点数是否相等  <a href="classlibemb_1_1_com_util.html#a104d0ba364c6234dc633495f69527ee3">More...</a><br /></td></tr>
<tr class="separator:a104d0ba364c6234dc633495f69527ee3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a537d2f696125d439f68d393448686883"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_com_util.html#a537d2f696125d439f68d393448686883">random</a> (int max)</td></tr>
<tr class="memdesc:a537d2f696125d439f68d393448686883"><td class="mdescLeft">&#160;</td><td class="mdescRight">生成伪随机数  <a href="classlibemb_1_1_com_util.html#a537d2f696125d439f68d393448686883">More...</a><br /></td></tr>
<tr class="separator:a537d2f696125d439f68d393448686883"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a695c760193341a8dd70e9f1cc2e5e032"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_com_util.html#a695c760193341a8dd70e9f1cc2e5e032">isBigEndian</a> (void)</td></tr>
<tr class="memdesc:a695c760193341a8dd70e9f1cc2e5e032"><td class="mdescLeft">&#160;</td><td class="mdescRight">判断本机是否是大端字节序  <a href="classlibemb_1_1_com_util.html#a695c760193341a8dd70e9f1cc2e5e032">More...</a><br /></td></tr>
<tr class="separator:a695c760193341a8dd70e9f1cc2e5e032"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aacf23841ca4033d2058cdcae4b30b919"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="_base_type_8h.html#aebf3b8d3c22313714b07d595cc3effac">uint16</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_com_util.html#aacf23841ca4033d2058cdcae4b30b919">host2LitEndian</a> (<a class="el" href="_base_type_8h.html#aebf3b8d3c22313714b07d595cc3effac">uint16</a> value)</td></tr>
<tr class="memdesc:aacf23841ca4033d2058cdcae4b30b919"><td class="mdescLeft">&#160;</td><td class="mdescRight">16位整数转换为小端字节序  <a href="classlibemb_1_1_com_util.html#aacf23841ca4033d2058cdcae4b30b919">More...</a><br /></td></tr>
<tr class="separator:aacf23841ca4033d2058cdcae4b30b919"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab141eac1d0e20f0cca59e237840275f4"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="_base_type_8h.html#a01991db9cc388cf9815386e13465f332">uint32</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_com_util.html#ab141eac1d0e20f0cca59e237840275f4">host2LitEndian</a> (<a class="el" href="_base_type_8h.html#a01991db9cc388cf9815386e13465f332">uint32</a> value)</td></tr>
<tr class="memdesc:ab141eac1d0e20f0cca59e237840275f4"><td class="mdescLeft">&#160;</td><td class="mdescRight">32位整数转换为小端字节序  <a href="classlibemb_1_1_com_util.html#ab141eac1d0e20f0cca59e237840275f4">More...</a><br /></td></tr>
<tr class="separator:ab141eac1d0e20f0cca59e237840275f4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad79450dac7bb6f6c50d7d60013a62678"><td class="memItemLeft" align="right" valign="top">static float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_com_util.html#ad79450dac7bb6f6c50d7d60013a62678">host2LitEndian</a> (float value)</td></tr>
<tr class="memdesc:ad79450dac7bb6f6c50d7d60013a62678"><td class="mdescLeft">&#160;</td><td class="mdescRight">32位浮点数转换为小端字节序  <a href="classlibemb_1_1_com_util.html#ad79450dac7bb6f6c50d7d60013a62678">More...</a><br /></td></tr>
<tr class="separator:ad79450dac7bb6f6c50d7d60013a62678"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0d831817ea429bc7d0580f2cd28698ef"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="_base_type_8h.html#aebf3b8d3c22313714b07d595cc3effac">uint16</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_com_util.html#a0d831817ea429bc7d0580f2cd28698ef">host2BigEndian</a> (<a class="el" href="_base_type_8h.html#aebf3b8d3c22313714b07d595cc3effac">uint16</a> value)</td></tr>
<tr class="memdesc:a0d831817ea429bc7d0580f2cd28698ef"><td class="mdescLeft">&#160;</td><td class="mdescRight">16位整数转换为大端字节序  <a href="classlibemb_1_1_com_util.html#a0d831817ea429bc7d0580f2cd28698ef">More...</a><br /></td></tr>
<tr class="separator:a0d831817ea429bc7d0580f2cd28698ef"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7aec515bc997b50e88511382c0852898"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="_base_type_8h.html#a01991db9cc388cf9815386e13465f332">uint32</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_com_util.html#a7aec515bc997b50e88511382c0852898">host2BigEndian</a> (<a class="el" href="_base_type_8h.html#a01991db9cc388cf9815386e13465f332">uint32</a> value)</td></tr>
<tr class="memdesc:a7aec515bc997b50e88511382c0852898"><td class="mdescLeft">&#160;</td><td class="mdescRight">32位整数转换为大端字节序  <a href="classlibemb_1_1_com_util.html#a7aec515bc997b50e88511382c0852898">More...</a><br /></td></tr>
<tr class="separator:a7aec515bc997b50e88511382c0852898"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3be168530cb6158770b228d78dcbf893"><td class="memItemLeft" align="right" valign="top">static float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_com_util.html#a3be168530cb6158770b228d78dcbf893">host2BigEndian</a> (float value)</td></tr>
<tr class="memdesc:a3be168530cb6158770b228d78dcbf893"><td class="mdescLeft">&#160;</td><td class="mdescRight">32位浮点数转换为大端字节序  <a href="classlibemb_1_1_com_util.html#a3be168530cb6158770b228d78dcbf893">More...</a><br /></td></tr>
<tr class="separator:a3be168530cb6158770b228d78dcbf893"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab87ca214da82963dd70a2028757c8207"><td class="memItemLeft" align="right" valign="top">static string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_com_util.html#ab87ca214da82963dd70a2028757c8207">unicodeOneToUtf8String</a> (<a class="el" href="_base_type_8h.html#a01991db9cc388cf9815386e13465f332">uint32</a> unicode)</td></tr>
<tr class="memdesc:ab87ca214da82963dd70a2028757c8207"><td class="mdescLeft">&#160;</td><td class="mdescRight">unicode转换位utf-8字符串  <a href="classlibemb_1_1_com_util.html#ab87ca214da82963dd70a2028757c8207">More...</a><br /></td></tr>
<tr class="separator:ab87ca214da82963dd70a2028757c8207"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2339229efcbd41cefba9057bcf2f33d7"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="_base_type_8h.html#a01991db9cc388cf9815386e13465f332">uint32</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_com_util.html#a2339229efcbd41cefba9057bcf2f33d7">utf8OneToUnicode</a> (const char *utf8code)</td></tr>
<tr class="memdesc:a2339229efcbd41cefba9057bcf2f33d7"><td class="mdescLeft">&#160;</td><td class="mdescRight">utf-8字符串转换位unicode编码  <a href="classlibemb_1_1_com_util.html#a2339229efcbd41cefba9057bcf2f33d7">More...</a><br /></td></tr>
<tr class="separator:a2339229efcbd41cefba9057bcf2f33d7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae4f685f7900454ecc6e0fc2cb6e0bbb7"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="_base_type_8h.html#a01991db9cc388cf9815386e13465f332">uint32</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_com_util.html#ae4f685f7900454ecc6e0fc2cb6e0bbb7">bitsReverse</a> (<a class="el" href="_base_type_8h.html#a01991db9cc388cf9815386e13465f332">uint32</a> value, <a class="el" href="_base_type_8h.html#addd0d1ba39d05a893db9eba78123ee5a">uint8</a> bits)</td></tr>
<tr class="memdesc:ae4f685f7900454ecc6e0fc2cb6e0bbb7"><td class="mdescLeft">&#160;</td><td class="mdescRight">位反转  <a href="classlibemb_1_1_com_util.html#ae4f685f7900454ecc6e0fc2cb6e0bbb7">More...</a><br /></td></tr>
<tr class="separator:ae4f685f7900454ecc6e0fc2cb6e0bbb7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab33525a07f114824222a0b64232c721e"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_com_util.html#ab33525a07f114824222a0b64232c721e">eval</a> (const char *expression)</td></tr>
<tr class="memdesc:ab33525a07f114824222a0b64232c721e"><td class="mdescLeft">&#160;</td><td class="mdescRight">表达式计算(暂未实现)  <a href="classlibemb_1_1_com_util.html#ab33525a07f114824222a0b64232c721e">More...</a><br /></td></tr>
<tr class="separator:ab33525a07f114824222a0b64232c721e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>通用工具类 </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="ae4f685f7900454ecc6e0fc2cb6e0bbb7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae4f685f7900454ecc6e0fc2cb6e0bbb7">&#9670;&nbsp;</a></span>bitsReverse()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="_base_type_8h.html#a01991db9cc388cf9815386e13465f332">uint32</a> libemb::ComUtil::bitsReverse </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="_base_type_8h.html#a01991db9cc388cf9815386e13465f332">uint32</a>&#160;</td>
          <td class="paramname"><em>value</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="_base_type_8h.html#addd0d1ba39d05a893db9eba78123ee5a">uint8</a>&#160;</td>
          <td class="paramname"><em>bits</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>位反转 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">value</td><td>值 </td></tr>
    <tr><td class="paramname">bits</td><td>要反转的位数(从最低位开始) </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>uint32 位反转后的值 </dd></dl>

</div>
</div>
<a id="a104d0ba364c6234dc633495f69527ee3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a104d0ba364c6234dc633495f69527ee3">&#9670;&nbsp;</a></span>equal()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool libemb::ComUtil::equal </td>
          <td>(</td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>f1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>f2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>precision</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>判断两个浮点数是否相等 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">f1</td><td>浮点数1 </td></tr>
    <tr><td class="paramname">f2</td><td>浮点数2 </td></tr>
    <tr><td class="paramname">precision</td><td>浮点精度 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true 相等 </dd>
<dd>
false 不相等 </dd></dl>

</div>
</div>
<a id="ab33525a07f114824222a0b64232c721e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab33525a07f114824222a0b64232c721e">&#9670;&nbsp;</a></span>eval()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int libemb::ComUtil::eval </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>expression</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>表达式计算(暂未实现) </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">expression</td><td>表达式 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>int 计算结果 </dd></dl>

</div>
</div>
<a id="a3be168530cb6158770b228d78dcbf893"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3be168530cb6158770b228d78dcbf893">&#9670;&nbsp;</a></span>host2BigEndian() <span class="overload">[1/3]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">float libemb::ComUtil::host2BigEndian </td>
          <td>(</td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>value</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>32位浮点数转换为大端字节序 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">value</td><td>32位浮点数 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>float 大端32位浮点数 </dd></dl>

</div>
</div>
<a id="a0d831817ea429bc7d0580f2cd28698ef"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0d831817ea429bc7d0580f2cd28698ef">&#9670;&nbsp;</a></span>host2BigEndian() <span class="overload">[2/3]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="_base_type_8h.html#aebf3b8d3c22313714b07d595cc3effac">uint16</a> libemb::ComUtil::host2BigEndian </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="_base_type_8h.html#aebf3b8d3c22313714b07d595cc3effac">uint16</a>&#160;</td>
          <td class="paramname"><em>value</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>16位整数转换为大端字节序 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">value</td><td>16位整数 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>uint16 大端16位整数 </dd></dl>

</div>
</div>
<a id="a7aec515bc997b50e88511382c0852898"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7aec515bc997b50e88511382c0852898">&#9670;&nbsp;</a></span>host2BigEndian() <span class="overload">[3/3]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="_base_type_8h.html#a01991db9cc388cf9815386e13465f332">uint32</a> libemb::ComUtil::host2BigEndian </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="_base_type_8h.html#a01991db9cc388cf9815386e13465f332">uint32</a>&#160;</td>
          <td class="paramname"><em>value</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>32位整数转换为大端字节序 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">value</td><td>32位整数 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>uint32 大端32位整数 </dd></dl>

</div>
</div>
<a id="ad79450dac7bb6f6c50d7d60013a62678"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad79450dac7bb6f6c50d7d60013a62678">&#9670;&nbsp;</a></span>host2LitEndian() <span class="overload">[1/3]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">float libemb::ComUtil::host2LitEndian </td>
          <td>(</td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>value</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>32位浮点数转换为小端字节序 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">value</td><td>32位浮点数 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>float 小端32位浮点数 </dd></dl>

</div>
</div>
<a id="aacf23841ca4033d2058cdcae4b30b919"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aacf23841ca4033d2058cdcae4b30b919">&#9670;&nbsp;</a></span>host2LitEndian() <span class="overload">[2/3]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="_base_type_8h.html#aebf3b8d3c22313714b07d595cc3effac">uint16</a> libemb::ComUtil::host2LitEndian </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="_base_type_8h.html#aebf3b8d3c22313714b07d595cc3effac">uint16</a>&#160;</td>
          <td class="paramname"><em>value</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>16位整数转换为小端字节序 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">value</td><td>16位整数 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>uint16 小端16位整数 </dd></dl>

</div>
</div>
<a id="ab141eac1d0e20f0cca59e237840275f4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab141eac1d0e20f0cca59e237840275f4">&#9670;&nbsp;</a></span>host2LitEndian() <span class="overload">[3/3]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="_base_type_8h.html#a01991db9cc388cf9815386e13465f332">uint32</a> libemb::ComUtil::host2LitEndian </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="_base_type_8h.html#a01991db9cc388cf9815386e13465f332">uint32</a>&#160;</td>
          <td class="paramname"><em>value</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>32位整数转换为小端字节序 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">value</td><td>32位整数 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>uint32 小端32位整数 </dd></dl>

</div>
</div>
<a id="a695c760193341a8dd70e9f1cc2e5e032"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a695c760193341a8dd70e9f1cc2e5e032">&#9670;&nbsp;</a></span>isBigEndian()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool libemb::ComUtil::isBigEndian </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>判断本机是否是大端字节序 </p>
<dl class="section return"><dt>Returns</dt><dd>true 是 </dd>
<dd>
false 不是 </dd></dl>

</div>
</div>
<a id="a537d2f696125d439f68d393448686883"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a537d2f696125d439f68d393448686883">&#9670;&nbsp;</a></span>random()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int libemb::ComUtil::random </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>max</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>生成伪随机数 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">max</td><td>最大值 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>int 生成的伪随机数 </dd></dl>

</div>
</div>
<a id="ab87ca214da82963dd70a2028757c8207"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab87ca214da82963dd70a2028757c8207">&#9670;&nbsp;</a></span>unicodeOneToUtf8String()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::string libemb::ComUtil::unicodeOneToUtf8String </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="_base_type_8h.html#a01991db9cc388cf9815386e13465f332">uint32</a>&#160;</td>
          <td class="paramname"><em>unicode</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>unicode转换位utf-8字符串 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">unicode</td><td>unicode编码 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>string utf-8字符串(1~6字节) </dd></dl>

</div>
</div>
<a id="a2339229efcbd41cefba9057bcf2f33d7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2339229efcbd41cefba9057bcf2f33d7">&#9670;&nbsp;</a></span>utf8OneToUnicode()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="_base_type_8h.html#a01991db9cc388cf9815386e13465f332">uint32</a> libemb::ComUtil::utf8OneToUnicode </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>utf8code</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>utf-8字符串转换位unicode编码 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">utf8code</td><td>utf-8字符串(1~6字节) </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>uint32 unicode编码 </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>src/<a class="el" href="_com_util_8h_source.html">ComUtil.h</a></li>
<li>src/ComUtil.cpp</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.18
</small></address>
</body>
</html>
